home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / COMMDIAL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  111 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.6  $
  6. //
  7. // Definition of Common Dialog abstract base class
  8. //----------------------------------------------------------------------------
  9. #if !defined(OWL_COMMDIAL_H)
  10. #define OWL_COMMDIAL_H
  11.  
  12. #if !defined(OWL_DIALOG_H)
  13. # include <owl/dialog.h>
  14. #endif
  15. #if !defined(__COMMDLG_H)
  16. # include <commdlg.h>
  17. #endif
  18. #if !defined(__CDERR_H)
  19. # include <cderr.h>
  20. #endif
  21.  
  22. #if defined(BI_NAMESPACE)
  23. namespace OWL {
  24. #endif
  25.  
  26. // Generic definitions/compiler options (eg. alignment) preceeding the 
  27. // definition of classes
  28. #include <services/preclass.h>
  29.  
  30. //
  31. // class TCommonDialog
  32. // ~~~~~ ~~~~~~~~~~~~~
  33. class _OWLCLASS TCommonDialog : public TDialog {
  34.   public:
  35.     TCommonDialog(TWindow* parent, const char far* title = 0, TModule* module = 0);
  36.    ~TCommonDialog();
  37.  
  38.     HWND DoCreate();
  39.     int  DoExecute();
  40.  
  41.   protected:
  42.     const char far* GetCDTitle() const;
  43.  
  44.     void SetupWindow();
  45.  
  46.     // Default behavior inline for message response functions
  47.     //
  48.     void CmOkCancel(); //EV_COMMAND(IDOK or IDCANCEL
  49.     void EvClose();    //EV_CLOSE
  50.     void CmHelp();     //EV_COMMAND(pshHelp,
  51.  
  52.   protected_data:
  53.     const char far* CDTitle;
  54.  
  55.   private:
  56.     TCommonDialog(const TCommonDialog&);
  57.     TCommonDialog& operator=(const TCommonDialog&);
  58.  
  59.   DECLARE_RESPONSE_TABLE(TCommonDialog);
  60.   DECLARE_CASTABLE;
  61. };
  62.  
  63. // Generic definitions/compiler options (eg. alignment) following the 
  64. // definition of classes
  65. #include <services/posclass.h>
  66.  
  67. #if defined(BI_NAMESPACE)
  68. } // namespace OWL
  69. #endif
  70.  
  71. #if defined(BI_PLAT_WIN16)
  72.   typedef UINT (CALLBACK *LPOFNHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  73.   typedef UINT (CALLBACK *LPCCHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  74.   typedef UINT (CALLBACK *LPFRHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  75.   typedef UINT (CALLBACK *LPCFHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  76.   typedef UINT (CALLBACK *LPPRINTHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  77.   typedef UINT (CALLBACK *LPSETUPHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  78. #endif
  79.   
  80. //----------------------------------------------------------------------------
  81. // Inline implementations
  82. //
  83.  
  84. //
  85. // Return the title from the common dialog.
  86. //
  87. inline const char far* TCommonDialog::GetCDTitle() const
  88. {
  89.   return CDTitle;
  90. }
  91.  
  92. //
  93. inline void TCommonDialog::CmOkCancel()
  94. {
  95.   DefaultProcessing();
  96. }
  97.  
  98. //
  99. inline void TCommonDialog::EvClose()
  100. {
  101.   DefaultProcessing();
  102. }
  103.  
  104. //
  105. inline void TCommonDialog::CmHelp()
  106. {
  107.   DefaultProcessing();
  108. }
  109.  
  110. #endif  // OWL_COMMDIAL_H
  111.